package com.rgs.se.string;

import java.io.IOException;

/**
 * @author Ren Gaoshuai
 * @ClassName TestSerial
 * @Description TODO
 * @date 2021-10-08 13:53
 **/
public class TestSerial {
    public static void main(String[] args) throws IOException {
//        FileOutputStream fos = new FileOutputStream(new File("G:\\student.out"));
//        ObjectOutputStream oos = new ObjectOutputStream(fos);
//        Student student = new Student("张三", 23, "男");
//        oos.writeObject(student);
//        oos.flush();
//        oos.close();
        /**
         * 从键盘接收
         *  new Scanner(System.in);
         *  new BufferedReader(new InputStreamReader(System.in));
         */
        System.out.println(testTry(3));
    }

    public static int testTry(int value){
        try {
            System.out.println("try");
            return value*value;
        }finally {
            System.out.println("finally");
            if (value == 2){
                return 1;
            }
        }
    }
}
